﻿@{
    ViewBag.Title = "SubPubWithData";
    Layout = "~/Views/Shared/_CwfPage.cshtml";
}

<h2>Sub Pub With Data</h2>

<div id="subDiv"></div>
<div id="pubDiv"></div>

<script type="text/javascript" src="/JS/ZeusApp/lordjs.subscriberWidget.js"></script>
<script type="text/javascript" src="/JS/ZeusApp/lordjs.publisherWidget.js"></script>

<script type="text/javascript">
    $(document).ready(function () {
        var books = [
            {
                "title": "Javascript Definitive Guide",
                "publish date": "2009-05-08",
                author: {
                    firstname: "David",
                    lastname: "Flanagan"
                }
            },
            {
                "title": "IOS Programming",
                "publish date": "2012-05-01",
                author: {
                    firstname: "Joe",
                    lastname: "Conway"
                }
            }
        ];

        // fill in subscriber widget
        $('#subDiv').subscriberWidget();

        // fill in publisher widget
        $('#pubDiv').publisherWidget({
            books: books
        });
    });
</script>
